package com.ruoyi.system.domain;

import java.math.BigDecimal;

import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 设计方案计算对象 mstn_scheme_compute
 * 
 * @author ruoyi
 * @date 2024-09-06
 */
@Data
public class MstnSchemeCompute extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 主键 */
    private Long schemeComputeId;

    /** 批次id */
    @Excel(name = "批次id")
    private Long batchId;

    /** 项目id */
    @Excel(name = "项目id")
    private Long projectId;

    /** 项目条件id */
    private Long projectConditionId;

    /** 工况类型(1=额定工况 2=混合石脑油EOR 3=混合C2SOR 4=HSSB 5=TLE-2 6=SD-1 ) */
    @Excel(name = "工况类型(1=额定工况 2=混合石脑油EOR 3=混合C2SOR 4=HSSB 5=TLE-2 6=SD-1 )")
    private String conditionType;

    /** 烟气流量 */
    @Excel(name = "烟气流量")
    private BigDecimal quantityFlow;

    /** 温度 */
    @Excel(name = "温度")
    private String temperature;

    /** 烟气压力 */
    @Excel(name = "烟气压力")
    private BigDecimal pressure;

    /** 氮氧化物 */
    @Excel(name = "氮氧化物")
    private BigDecimal nox;

    /** 二氧化氮 */
    @Excel(name = "二氧化氮")
    private BigDecimal no2;

    /** 氮气 */
    @Excel(name = "氮气")
    private BigDecimal n2;

    /** 氧含量 */
    @Excel(name = "氧含量")
    private BigDecimal o;

    /** 水蒸汽 */
    @Excel(name = "水蒸汽")
    private BigDecimal h2o;

    /** 一氧化碳 */
    @Excel(name = "一氧化碳")
    private BigDecimal co;

    /** 二氧化碳 */
    @Excel(name = "二氧化碳")
    private BigDecimal co2;

    /** 二氧化硫 */
    @Excel(name = "二氧化硫")
    private BigDecimal so2;

    /** 三氧化硫 */
    @Excel(name = "三氧化硫")
    private BigDecimal so3;

    /** 颗粒物 */
    @Excel(name = "颗粒物")
    private BigDecimal pm;

    /** 性能保证前提条件 */
    private String  precondition;
    /** 其他备注说明 */
    private String remark;

    /** 催化剂总体积 */
    private BigDecimal zv;

    /**
     * 建议流速
     */
    private BigDecimal flowRate;

    /**
     * 催化剂截面积
     */
    private BigDecimal s;

    /**
     * 催化剂高度
     */
    private BigDecimal catalystsH;

    /**
     * 面积
     */
    private BigDecimal catalystsN;

    /** 矩阵X */
    private Integer matrixX;
    /** 矩阵Y */
    private Integer matrixY;

    /** 层数 */
    private Integer floors;
    /** 反应器L */
    private Integer reactorL;
    /** 反应器W */
    private Integer reactorW;

    /**
     * 实际体积
     */
    private BigDecimal vc;
    /**
     * 实际余量
     */
    private BigDecimal rc;
    /**
     * 已选模块名称
     */
    private String selectModuleName;
    /** 建议矩阵X */
    private BigDecimal suggestMatrixX;
    /** 建议矩阵Y */
    private BigDecimal suggestMatrixY;
    /**
     * 建议高度
     */
    private BigDecimal suggestH;
    /** 模块名称 */
    private String moduleName;

    private Boolean needCheck;
    public static MstnSchemeCompute of(Long batchId, MstnProjectCondition condition){
        MstnSchemeCompute schemeCompute = new MstnSchemeCompute();
        schemeCompute.setBatchId(batchId);
        schemeCompute.setProjectId(condition.getProjectId());
        schemeCompute.setConditionType(condition.getConditionType());
        schemeCompute.setQuantityFlow(condition.getQuantityFlow());
        schemeCompute.setTemperature(condition.getTemperatureLow() + "" + condition.getTemperatureHigh());
        schemeCompute.setPressure(condition.getPressure());
        schemeCompute.setNox(condition.getNox());
        schemeCompute.setNo2(condition.getNo2());
        schemeCompute.setN2(condition.getN2());
        schemeCompute.setO(condition.getO());
        schemeCompute.setH2o(condition.getH2o());
        schemeCompute.setCo(condition.getCo());
        schemeCompute.setCo2(condition.getCo2());
        schemeCompute.setSo2(condition.getSo2());
        schemeCompute.setSo3(condition.getSo3());
        schemeCompute.setPm(condition.getPm());
        return schemeCompute;
    }
    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("schemeComputeId", getSchemeComputeId())
            .append("batchId", getBatchId())
            .append("projectId", getProjectId())
            .append("conditionType", getConditionType())
            .append("quantityFlow", getQuantityFlow())
            .append("temperature", getTemperature())
            .append("pressure", getPressure())
            .append("nox", getNox())
            .append("no2", getNo2())
            .append("o", getO())
            .append("h2o", getH2o())
            .append("co", getCo())
            .append("co2", getCo2())
            .append("so2", getSo2())
            .append("so3", getSo3())
            .append("pm", getPm())
            .toString();
    }

    public String getContentByIndex(int index){
        switch (index){
            case 0:
                switch (conditionType){
                    case "1": return "额定工况";
                    case "2": return "混合石脑油EOR";
                    case "3": return "混合C2SOR";
                    case "4": return "HSSB";
                    case "5": return "TLE-2";
                    case "6": return "SD-1";
                    default: return "";
                }
            case 1: return quantityFlow.toString();
            case 2: return temperature.toString();
            case 3: return pressure.toString();
            case 4: return nox.toString();
            case 5: return no2.toString();
            case 6: return o.toString();
            case 7: return h2o.toString();
            case 8: return co.toString();
            case 9: return co2.toString();
            case 10: return so2.toString();
            case 11: return so3.toString();
            case 12: return pm.toString();
            default: return "";

        }
    }
}
